package com.example.stock.util;

import com.example.stock.service.impl.GBStaServiceImpl;
import lombok.Getter;

@Getter
public enum StocksRollSearchEnum {
    OP_60W_UP(GBStaConstant.OP_60W_UP, GBStaServiceImpl.GB_60W_K),
    OP_30W_UP(GBStaConstant.OP_30W_UP, GBStaServiceImpl.GB_30W_K),
    OP_20W_UP(GBStaConstant.OP_20W_UP, GBStaServiceImpl.GB_20W_K),
    OP_15W_UP(GBStaConstant.OP_15W_UP, GBStaServiceImpl.GB_15W_K);

    private final String op;

    private final String sourceType;

    StocksRollSearchEnum(String op, String sourceType) {
        this.op = op;
        this.sourceType = sourceType;
    }

    public static StocksRollSearchEnum getByOP(String OP) {
        return switch (OP) {
            case GBStaConstant.OP_60W_UP -> StocksRollSearchEnum.OP_60W_UP;
            case GBStaConstant.OP_30W_UP -> StocksRollSearchEnum.OP_30W_UP;
            case GBStaConstant.OP_20W_UP -> StocksRollSearchEnum.OP_20W_UP;
            case GBStaConstant.OP_15W_UP -> StocksRollSearchEnum.OP_15W_UP;
            default -> null;
        };
    }
}
